package com.easylinkin.linkappapi.building.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.util.Date;


@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("app_floor")
public class Floor extends Model<Floor> {
    /**
     * 主键
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 基于谁在新建
     */
    @TableField(exist = false)
    private Integer baseId;

    /**
     * 租户id
     */

    private String tenantId;

    /**
     * 单体名称
     */
    private String name;

    /**
     * 单体id
     */

    private Integer buildingId;

    /**
     * 楼层类型，0-基础层，1-首层,2-其他
     */
    private Integer type;

    /**
     * 排序号，首层是0
     */
    private Integer sortNo;


    /**
     * 建筑层高
     */

    private Float buildingFloorHeight;

    /**
     * 结构层高
     */

    private Float structureFloorHeight;

    /**
     * 建筑底标高
     */

    private Float buildingStandardHeight;

    /**
     * 结构底标高
     */

    private Float structureStandardHeight;

    /**
     * 创建时间
     */

    private Date createTime;

    /**
     * 修改时间
     */

    private Date modifyTime;

    /**
     * 创建人
     */
    private String creator;

    /**
     * 修改人
     */
    private String modifier;

    /**
     * 经度
     */
    @TableField(value = "longitude_")
    private Float longitude;

    /**
     * 纬度
     */
    @TableField(value = "latitude_")
    private Float latitude;

    /**
     * 文件路径
     */
    @TableField(value = "file_url_")
    private String fileUrl;

    /**
     * 楼层人数
     */
    @TableField(exist = false)
    private Integer num;

    public Floor() {
    }

    public Floor(String name, Integer buildingId, Integer type, Integer sortNo, Float buildingFloorHeight, Float structureFloorHeight, Float buildingStandardHeight, Float structureStandardHeight) {
        this.name = name;
        this.buildingId = buildingId;
        this.type = type;
        this.sortNo = sortNo;
        this.buildingFloorHeight = buildingFloorHeight;
        this.structureFloorHeight = structureFloorHeight;
        this.buildingStandardHeight = buildingStandardHeight;
        this.structureStandardHeight = structureStandardHeight;
    }

    public Floor(String name, Integer buildingId, Integer type, Float buildingFloorHeight, Float structureFloorHeight) {
        this.name = name;
        this.buildingId = buildingId;
        this.type = type;
        this.buildingFloorHeight = buildingFloorHeight;
        this.structureFloorHeight = structureFloorHeight;
    }
}
